//
//  FLDView.m
//  TheTimer
//
//  Created by 深津 貴之 on 08/12/27.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "FLDView.h"


@implementation FLDView

@synthesize size;
@synthesize origin;
@synthesize x;
@synthesize y;
@synthesize width;
@synthesize height;

@synthesize top;
@synthesize bottom;
@synthesize left;
@synthesize right;

-(CGSize)size
{
	return self.frame.size;
}

-(void)setSize:(CGSize)size
{
	CGRect theFrame = self.frame;
	theFrame.size = size;
	self.frame = theFrame;
}

-(CGPoint)origin
{
	return self.frame.origin;
}

-(void)setOrigin:(CGPoint)point
{
	CGRect theFrame = self.frame;
	theFrame.origin = point;
	self.frame = theFrame;
}

-(float)x
{
	return self.frame.origin.x;
}

-(void)setX:(float)value
{
	[self setOrigin: CGPointMake(value, self.y)];
}

-(float)y
{
	return self.frame.origin.y;
}

-(void)setY:(float)value
{
	[self setOrigin: CGPointMake(self.x, value)];
}

-(float)width
{
	return self.frame.size.width;
}

-(void)setWidth:(float)value
{
	[self setSize:CGSizeMake(value, self.height)];
}

-(float)height
{
	return self.frame.size.height;
}

-(void)setHeight:(float)value
{
	[self setSize:CGSizeMake(self.width, value)];
}
		 
-(float)top
{
	return self.y;
}

-(void)setTop:(float)value
{
	self.y = value;
}

-(float)bottom
{
	return self.height + self.y;
}

-(void)setBottom:(float)value
{
	self.y = value - self.height;
}


-(float)left
{
	return self.x;
}

-(void)setLeft:(float)value
{
	self.x = value;
}

-(float)right
{
	return self.width + self.x;
}

-(void)setRight:(float)value
{
	self.x = value - self.width;
}


@end
